﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Profile.aspx.vb" Inherits="Final_Web_2._0_site_1.Profile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:Button ID="btn_EditProfile" runat="server" Text="Edit Profile" 
            PostBackUrl="~/ProfileEdit.aspx" />


    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btn_profile" runat="server" Text="Click here to view Profile" />


    </p>
    <p>


        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataSourceID="ProfilePageGVSqlDataSource1" Height="50px" Width="125px" 
            CellPadding="4" ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <EditRowStyle BackColor="#999999" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
            <Fields>
                <asp:ImageField DataImageUrlField="UserImage" DataImageUrlFormatString="{0}" 
                    HeaderText="Picture">
                    <ControlStyle Height="200px" Width="200px" />
                </asp:ImageField>
                <asp:BoundField DataField="Username" HeaderText="Username" 
                    SortExpression="Username" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                    SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" 
                    SortExpression="LastName" />
                <asp:BoundField DataField="Gender" HeaderText="Gender" 
                    SortExpression="Gender" />
                <asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                <asp:BoundField DataField="AboutMe" HeaderText="AboutMe" 
                    SortExpression="AboutMe" />
                <asp:BoundField DataField="RegistrationDate" HeaderText="RegistrationDate" 
                    SortExpression="RegistrationDate" />
                <asp:BoundField DataField="FavouriteColour" HeaderText="FavouriteColour" 
                    SortExpression="FavouriteColour" />
            </Fields>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        </asp:DetailsView>
        <asp:SqlDataSource ID="ProfilePageGVSqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MercedesConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:MercedesConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Username], [Email], [Title], [FirstName], [LastName], [DOB], [AboutMe], [RegistrationDate], [FavouriteColour], [Gender], [UserImage] FROM [UserProfile] WHERE ([Username] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Username" QueryStringField="Username" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        List of Cars this User uploaded.
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataSourceID="UsersCarUploadsSqlDataSource1" 
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:ImageField DataImageUrlField="CarPicture" DataImageUrlFormatString="{0}" 
                    HeaderText="Picture">
                    <ControlStyle Height="150px" Width="175px" />
                </asp:ImageField>
                <asp:BoundField DataField="CarModelName" HeaderText="Model Name" 
                    SortExpression="CarModelName" />
                <asp:BoundField DataField="CarModelYear" HeaderText="Model Year" 
                    SortExpression="CarModelYear" />
                <asp:BoundField DataField="CC" HeaderText="CC" SortExpression="CC" />
                <asp:BoundField DataField="CarColour" HeaderText="Colour" 
                    SortExpression="CarColour" />
                <asp:HyperLinkField DataNavigateUrlFormatString="{0}" 
                    DataTextField="CarInfoURL" DataTextFormatString="More" HeaderText="Info" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
        <asp:SqlDataSource ID="UsersCarUploadsSqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MercedesConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:MercedesConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT DISTINCT [CarModelName], [CarModelYear], [CC], [CarColour], [CarInfoURL], [UserName], [CarPicture] FROM [ProfileUsersUploadsCars] WHERE ([UserName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="UserName" QueryStringField="UserName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
    </p>
    <p>
    </p>
    <p>
    </p>
</asp:Content>
